package com.ytjj.qmyx.mall.model.response;

import com.ytjj.qmyx.mall.model.ProductSpec;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;

/**
 * 商品规格响应实体
 *
 *
 * @version 1.0
 *
 */
@Data
public class ProductSpecResponse {

    /**
     * 主键
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     * 商品id
     *
     * @mbg.generated
     */
    private Integer productId;

    /**
     * sku规格json
     *
     * @mbg.generated
     */
    private String skuSpec;

    /**
     * 价格
     *
     * @mbg.generated
     */
    private BigDecimal price;

    /**
     * 原价
     *
     * @mbg.generated
     */
    private BigDecimal originalPrice;


    /**
     * 商品图
     *
     * @mbg.generated
     */
    private String proImg;

    /**
     * 销量
     *
     * @mbg.generated
     */
    private Integer buySum;

    /**
     * 库存
     *
     * @mbg.generated
     */
    private Integer stock;

    /**
     * 直接购买价
     *
     * @mbg.generated
     */
    private BigDecimal curPrice;

    /**
     * 购买时的成本价
     */
    private BigDecimal costPrice;

    /**
     * 外部供应商id
     */
    private String threeSkuId;

    public ProductSpecResponse(){}

    public ProductSpecResponse(ProductSpec productSpec){
        BeanUtils.copyProperties(productSpec,this);
        this.setCostPrice(BigDecimal.ZERO);
    }
}
